package zuoye;

public class SingleDemo2 {
    public static void main(String[] args) {
        Single2 ss1 = Single2.getSingle();
        Single2 ss2 =  Single2.getSingle();
        Single2 ss3 = Single2.getSingle();
        System.out.println(ss1==ss2);
        System.out.println(ss3==ss2);


    }

}
class Single2{
    private Single2(){
    }
    private static Single2 single2=new Single2();

    public static Single2 getSingle(){
        return single2;
    }
}
